From fe6238d1c48d1a7a9844d3421001b120761e1e2e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 12 May 2020 15:56:46 -0400 Subject: [PATCH] tests: Drop the visuals test This was just a different way to load a ui file and try it with dark mode. This can be done with gtk-builder-tool preview and GTK_THEME. --- tests/meson.build | 2 - tests/visuals/level-bar.ui | 148 ------------------ tests/visuals/linked-buttons-horizontal.ui | 51 ------- tests/visuals/linked-buttons-vertical.ui | 51 ------- tests/visuals/meson.build | 1 - tests/visuals/osd-toolbars.ui | 168 --------------------- tests/visuals/suggested-action-buttons.ui | 80 ---------- tests/visuals/visuals.c | 95 ------------ 8 files changed, 596 deletions(-) delete mode 100644 tests/visuals/level-bar.ui delete mode 100644 tests/visuals/linked-buttons-horizontal.ui delete mode 100644 tests/visuals/linked-buttons-vertical.ui delete mode 100644 tests/visuals/meson.build delete mode 100644 tests/visuals/osd-toolbars.ui delete mode 100644 tests/visuals/suggested-action-buttons.ui delete mode 100644 tests/visuals/visuals.c diff --git a/tests/meson.build b/tests/meson.build index 7b9d76c732..3bcda9440c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -153,5 +153,3 @@ if get_option('profiler') executable('testperf', 'testperf.c', dependencies: [profiler_dep, platform_gio_dep, libm]) endif - -subdir('visuals') diff --git a/tests/visuals/level-bar.ui b/tests/visuals/level-bar.ui deleted file mode 100644 index 1fa328b149..0000000000 --- a/tests/visuals/level-bar.ui +++ /dev/null @@ -1,148 +0,0 @@ - - - - - False - 600 - 600 - - - vertical - 12 - True - True - True - - - True - False - vertical - 12 - - - True - Continuous values - - - - - True - true - 0.09 - - - - - - - - - True - true - 0.20 - - - - - True - true - 0.5 - - - - - True - true - 1.0 - - - - - True - Discrete values - - - - - True - true - 2.8 - 0.0 - 5.0 - discrete - - - - - - - - - - - True - False - horizontal - 12 - center - - - True - Continuous values - - - - - True - true - vertical - 0.09 - - - - - True - true - vertical - 0.2 - - - - - True - true - vertical - 0.5 - - - - - True - true - vertical - 1.0 - - - - - True - Discrete values - - - - - True - true - vertical - 15.0 - 10.0 - 15.0 - discrete - - - - - - - - diff --git a/tests/visuals/linked-buttons-horizontal.ui b/tests/visuals/linked-buttons-horizontal.ui deleted file mode 100644 index e726d3fec1..0000000000 --- a/tests/visuals/linked-buttons-horizontal.ui +++ /dev/null @@ -1,51 +0,0 @@ - - - - - False - 600 - 600 - - - True - False - horizontal - center - center - - - - Hi, I am a button - False - True - True - True - False - - - - - And I'm another button - False - True - True - True - False - - - - - This is a button party! - False - True - True - True - False - - - - - - diff --git a/tests/visuals/linked-buttons-vertical.ui b/tests/visuals/linked-buttons-vertical.ui deleted file mode 100644 index f7c40ed216..0000000000 --- a/tests/visuals/linked-buttons-vertical.ui +++ /dev/null @@ -1,51 +0,0 @@ - - - - - False - 600 - 600 - - - True - False - vertical - center - center - - - - Hi, I am a button - False - True - True - True - False - - - - - And I'm another button - False - True - True - True - False - - - - - This is a button party! - False - True - True - True - False - - - - - - diff --git a/tests/visuals/meson.build b/tests/visuals/meson.build deleted file mode 100644 index ae18412ef6..0000000000 --- a/tests/visuals/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('visuals', 'visuals.c', dependencies: libgtk_dep) diff --git a/tests/visuals/osd-toolbars.ui b/tests/visuals/osd-toolbars.ui deleted file mode 100644 index 4211375234..0000000000 --- a/tests/visuals/osd-toolbars.ui +++ /dev/null @@ -1,168 +0,0 @@ - - - 600 - 600 - - - - - - - - 0 - center - end - 24 - - - - - - - - - - camera-web-symbolic - - - - - - - 1 - - - audio-volume-medium-symbolic - - - - - - - 0 - - - audio-input-microphone-symbolic - - - - - - - 0 - 1 - - - bluetooth-active-symbolic - - - - - - - - - - - True - 0 - - - - - - - OSD Toolbar - 10 - 10 - - - - - - - - - - - - - media-optical-symbolic - - - - - - - 1 - - - drive-harddisk-symbolic - - - - - - - 0 - - - input-gaming-symbolic - - - - - - - - - - - - - 0 - center - start - 24 - - - - edit-undo-symbolic - - - - - edit-redo-symbolic - - - - - start-here-symbolic - - - - - applications-science-symbolic - - - - - - - Another kind of OSD toolbar - 10 - 10 - - - - - - - - - - diff --git a/tests/visuals/suggested-action-buttons.ui b/tests/visuals/suggested-action-buttons.ui deleted file mode 100644 index 4360bdc201..0000000000 --- a/tests/visuals/suggested-action-buttons.ui +++ /dev/null @@ -1,80 +0,0 @@ - - - - - False - 600 - 600 - - - True - False - vertical - center - center - 6 - - - True - False - horizontal - center - center - 6 - - - Hi, I am a button - False - True - True - True - False - - - - - And I'm the suggested action - False - True - True - True - False - - - - - - - - True - False - horizontal - - - - False - True - False - Inside selection mode - True - True - - - - False - True - - - - - - - - diff --git a/tests/visuals/visuals.c b/tests/visuals/visuals.c deleted file mode 100644 index b3232fa7b8..0000000000 --- a/tests/visuals/visuals.c +++ /dev/null @@ -1,95 +0,0 @@ -/* visuals: UI runner for visual GtkBuilder files - * - * Copyright (C) 2012 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * - * Author: Cosimo Cecchi - * - */ - -#include - -static void -dark_button_toggled_cb (GtkToggleButton *button, - gpointer user_data) -{ - gboolean active = gtk_toggle_button_get_active (button); - GtkSettings *settings = gtk_settings_get_default (); - - g_object_set (settings, - "gtk-application-prefer-dark-theme", active, - NULL); -} - -static void -create_dark_popup (GtkWidget *parent) -{ - GtkWidget *popup = gtk_window_new (); - GtkWidget *button = gtk_toggle_button_new_with_label ("Dark"); - - gtk_window_set_decorated (GTK_WINDOW (popup), FALSE); - gtk_widget_set_size_request (popup, 100, 100); - gtk_window_set_resizable (GTK_WINDOW (popup), FALSE); - gtk_window_set_hide_on_close (GTK_WINDOW (popup), TRUE); - - gtk_window_set_child (GTK_WINDOW (popup), button); - g_signal_connect (button, "toggled", - G_CALLBACK (dark_button_toggled_cb), NULL); - - gtk_window_set_transient_for (GTK_WINDOW (popup), GTK_WINDOW (parent)); - - gtk_widget_show (popup); -} - -static void -quit_cb (GtkWidget *widget, - gpointer data) -{ - gboolean *done = data; - - *done = TRUE; - - g_main_context_wakeup (NULL); -} - -int -main (int argc, char *argv[]) -{ - GtkBuilder *builder; - GtkWidget *window; - const gchar *filename; - gboolean done = FALSE; - - gtk_init (); - - if (argc < 2) - return 1; - filename = argv[1]; - - builder = gtk_builder_new (); - gtk_builder_add_from_file (builder, filename, NULL); - - window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); - g_object_unref (G_OBJECT (builder)); - g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done); - gtk_widget_show (window); - - create_dark_popup (window); - - while (!done) - g_main_context_iteration (NULL, TRUE); - - return 0; -} -- 2.30.2